<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<script>
	var ctx = "${ctx}";
</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>我的赛事</title>
<meta name="keywords"
	content="">
<meta name="description"
	content="">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, 26 Feb 209908:21:57 GMT">

	<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/font-awesome.min.css?v=4.4.0?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/animate.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/style.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/common.css?v=${static_version}" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css" rel="stylesheet">
	<!-- Data Tables -->
	<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css?v=${static_version}" rel="stylesheet" />
</head>
<body class="gray-bg">

	<div class="wrapper wrapper-content  animated fadeInRight">
			<div class="ibox float-e-margins">
			
			 <div class="ibox-title">
                    <h5>我的赛事<small></small></h5>
                </div>			
				<div class="ibox-content">
					<div class="row  m-b-xs">
					<form  action="${ctx}/match-game" method="get"  class="form-group" id="member_table_form">
						<div class="col-sm-1 m-t-xs">类型：</div> 
					<div class="col-md-2 col-sm-2">
						<select data-placeholder="--不限--" name="match_cate" class="input-md form-control chosen-select" tabindex="4">
		                    <option value="1"
		                     <c:if test="${1==match_cate }">selected</c:if>>我参赛的</option>
	                    	<option value="2"
	                    	<c:if test="${2==match_cate }">selected</c:if>>我参投的</option>
	                    	<option value="3"
	                    	<c:if test="${3==match_cate }">selected</c:if>>我获奖的</option>
		                </select>
					</div>
							
					<div class="col-md-1 col-sm-1">
						<button name="" id="" class="btn btn-primary radius" type="submit">查询</button>								
					</div>	
					<div class="col-md-1">
						<a class="btn btn-warning btn-outline radius" onclick="javascript:location.replace(location.href);"
						href="javascript:location.replace(location.href);">刷新</a> 
				    </div>
								
				</form>
				
				</div>
					
					<div class="hr-line-dashed3"></div>		
			<table data-action="" data-datatable="true"  class="table table-striped table-bordered table-hover dataTables-example">
				<thead>
					<tr>                        
                        <th class="text-center">赛事名称</th>
                        <th class="text-center">缩略图</th>
                        <th class="text-center">跳转至H5</th>                          
                        <th class="text-center">比赛截止时间</th>
                        <th class="text-center">我的参赛时间</th>
                        <th class="text-center">状态</th>                         
						<th class="text-center">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${u_matchs}" var="u_match">						
						<tr class="text-c">
					
                            <td class="text-center">${u_match.match_name}</td>
                            <td class="text-center">
                            	<img src = "${u_match.thumbnail}" style="width:50px;height:50px">
                            </td>
                            <td class="text-center">${u_match.thumbnail_h5}</td>
                            <td class="text-center">${u_match.pstart_time}
                            		至
                            	${u_match.pend_time}
                            </td>
                            <td class="text-center" >${u_match.pstart_time}</td>
                            <td class="text-center">
                             <c:if test="${u_match.status == 0}">
                           		  进行中
                           	</c:if>
                             <c:if test="${u_match.status == 1}">
                           		  已结束
                           	</c:if>
                           </td>                             
							<td class="td-manage text-center">
							<a class="btn btn-primary radius"
								onClick="u_match_detail(this,'${u_match.match_id}')" href="javascript:void(0);"
								title="查看详情">查看详情</a>
								&nbsp;&nbsp;&nbsp;&nbsp;						
							<a class="btn btn-primary radius"
								onClick="u_match_delete(this,'${u_match.match_id}')" href="javascript:void(0);"
								title="删除">删除</a>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	</div>
	
	
	<script src="${ctx}/static/js/jquery.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/bootstrap.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/layer/layer.js?v=${static_version}"></script>
		<script
		src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js?v=${static_version}"></script>
	<script
		src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js?v=${static_version}"></script>
	<script type="text/javascript">
	$(document).ready(function() {
		$(".dataTables-example").dataTable();
	});
	
	
	 /*查看详情*/
	function u_match_detail(obj,id,w,h){
		var info_page = "${ctx}/match-detail-info?id="+id;
		var index = layer.open({
			type: 2,
			title: "查看详情",
			content: info_page
		});
		layer.full(index);
	}
	

	/*删除*/
	function u_match_delete(obj,id){
		layer.confirm('确认删除？', {
			btn: ['确认','取消'], 
			shade: false
		},
		function(){
			$.ajax({
				type : "POST",
				url :"${ctx}/match-delete ",
				data : "id=" + id,
				error : function() {
					layer.msg('操作失败', {icon:5,time:1000});
				},
				success : function(msg) {
					layer.msg('已删除 ', {icon:6,time:1000});
					location.href ="${ctx}/match-game"; 
				}
			});
		},
		function(){
			layer.msg('未删除', {icon:5,time:1000});
		});	
	} 
	
	
	</script>
</body>

</html>